<?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 (!class_exists('auth')) {
  include_once("../lib/lib_common.php");
  ReloadIndex('admin');
}
////////////



/** Préparation du mail
 * $email_html_body
 * $email_text_body
 * $email_subject
 * $email_recipient
 **/
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 /><br />\n";
    $email_html_body .= _t('user','login') . " : " . $u_login . "<br />\n";
    $email_html_body .= _t('user','password') . " : " . $u_password . "<br />\n";

    $email_text_body = _t('user','mail_add_body1') . "\n";
    $email_text_body .= _t('user','mail_add_body2') . "\n\n";
    $email_text_body .= _t('user','login') . " : " . $u_login . "\n";
    $email_text_body .= _t('user','password') . " : " . $u_password . "\n";

    $email_subject = mb_ucfirst(_t('user','mail_add_subject')).' - '.SITE_NAME;
    $email_recipient = $u_mail;
    break;
  case 'change_pass':
    $email_html_body = _t('user','mail_changepass_body1') . "<br />\n";
    $email_html_body .= _t('user','mail_changepass_body2') . "<br /><br />\n";
    $email_html_body .= _t('user','login') . " : " . $user_login . "<br />\n";
    $email_html_body .= _t('user','password') . " : " . $new_pass . "<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','login') . " : " . $user_login . "\n";
    $email_text_body .= _t('user','password') . " : " . $new_pass . "\n";

    $email_subject = mb_ucfirst(_t('user','mail_changemail_subject')).' - '.SITE_NAME;
    $email_recipient = $user_email;
    break;
  case 'forgot_pass':
    $email_html_body  = _t('user','mail_forgotpass_body1') . "<br />\n";
    $email_html_body .= '<em>'._t('user','mail_forgotpass_body2') . "</em><br /><br />\n";
    $email_html_body .= "<a href='".SITE_ROOT_URL. 'public/'.get_permalink($link_pass)."'>".SITE_ROOT_URL. 'public/'.get_permalink($link_pass)."</a><br />\n";
    	
    $email_text_body  = _t('user','mail_forgotpass_body1') . "\n";
    $email_text_body .= _t('user','mail_forgotpass_body2') . "\n";
    $email_text_body .= SITE_ROOT_URL. 'public/'.get_permalink($link_pass). "\n";

    $email_subject = mb_ucfirst(_t('user','mail_forgotpass_subject')).' - '.SITE_NAME;
    $email_recipient = $user_email;
    break;
  case 'change_mail':
    $email_html_body = _t('user','mail_changemail_body1') . "<br />\n";
    $email_html_body .= _t('user','mail_changemail_body2') . "<br /><br />\n";
    $email_html_body .= _t('user','login') . " : " . $user_login . "<br />\n";
    $email_html_body .= _t('user','password') . " : " . $new_pass . "<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','login') . " : " . $user_login . "\n";
    $email_text_body .= _t('user','password') . " : " . $new_pass . "\n";

    $email_subject = mb_ucfirst(_t('user','mail_changemail_subject')).' - '.SITE_NAME;

    $email_recipient = $new_email;
    break;
  case 'change_login':
    	$email_html_body = _t('user','mail_changelogin_body1') . '<b>' . $new_login . "</b><br />\n";
    	 
    	$email_text_body = _t('user','mail_changelogin_body1'). $new_login . "\n";
    
    	$email_subject = mb_ucfirst(_t('user','mail_changelogin_subject')).' - '.SITE_NAME;
    
    	$email_recipient = $user_email;
    	break;
  default:
    exit();
}

?>