Commit 876c6b9b authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add email sent when creating a new user

parent ecfb9c07
......@@ -494,6 +494,8 @@ class tx_nG6_eid {
$first_name = trim(t3lib_div::_GP('first_name'));
$last_name = trim(t3lib_div::_GP('last_name'));
$add_user_email = trim(t3lib_div::_GP('add_user_email'));
$add_user_title = trim(t3lib_div::_GP('add_user_title'));
$email = trim(t3lib_div::_GP('email'));
$password = trim(t3lib_div::_GP('password'));
$cruser_id = trim(t3lib_div::_GP('creator'));
......@@ -506,6 +508,14 @@ class tx_nG6_eid {
// authorize new access
tx_nG6_db::add_access_to_project($new_id, $project_id, $right_id);
// send an email to the new user
$message = str_replace("###USER_FIRST_NAME###", $first_name, $add_user_email);
$message = str_replace("###USER_LAST_NAME###", $last_name, $message);
$message = str_replace("###USER_LOGIN###", $user_name, $message);
$message = str_replace("###USER_PASSWORD###", $password, $message);
mail($email, $add_user_title, $message, "From: <genotoul@example.com>");
print '2';
// user exists in DB
......
......@@ -27,6 +27,8 @@
<label index="manage_users">Users</label>
<label index="delete_user_btn">Delete</label>
<label index="add_user_btn">Add</label>
<label index="add_user_title">NG6 account creation</label>
<label index="add_user_email">Dear ###USER_FIRST_NAME### ###USER_LAST_NAME###,\n Please find bellow your login/password required to log into the NG6 system (http://ng6.toulouse.inra.fr): \n - login: ###USER_LOGIN###, \n - password: ###USER_PASSWORD###.\n The NG6 team\n PS: this is an automatic e-mail message generated by the NG6 system. Please DO NOT RESPOND to this e-mail because the mail box is unattended.</label>
<label index="close_btn_label">Close</label>
<label index="user_login">Login : </label>
<label index="user_pwd">Password : </label>
......@@ -452,6 +454,8 @@
<label index="manage_users">Utilisateurs</label>
<label index="delete_user_btn">Supprimer</label>
<label index="add_user_btn">Ajouter</label>
<label index="add_user_title">Création de compte NG6</label>
<label index="add_user_email">###USER_FIRST_NAME### ###USER_LAST_NAME###,\n Veuillez trouver ci-joint votre login/mot de passe nécessaire afin de se loguer à NG6 (http://ng6.toulouse.inra.fr): \n - login: ###USER_LOGIN###, \n - mot de passe: ###USER_PASSWORD###.\n L'équipe NG6\n PS: ceci est un mail généré automatiquement par NG6. Veuillez ne repondez pas à cet e-mail.</label>
<label index="close_btn_label">Fermer</label>
<label index="run_list">Liste des runs auxquels vous avez accès :</label>
<label index="project">Projet</label>
......
......@@ -49,7 +49,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input type="hidden" id="error_dialog_empty_password" value="{$llang.error_dialog_empty_password}" />
<input type="hidden" id="user_login" value="{$llang.user_login}" />
<input type="hidden" id="user_pwd" value="{$llang.user_pwd}" />
<input type="hidden" id="user_login" value="{$llang.user_login}" />
<input type="hidden" id="add_user_email" value="{$llang.add_user_email}" />
<input type="hidden" id="add_user_title" value="{$llang.add_user_title}" />
<input type="hidden" id="user_id" value="{$user_id}" />
<input type="hidden" id="pid" value="{$pid}" />
......
......@@ -1108,6 +1108,8 @@ $(function () {
val_url += "&project_id=" + $("#current_project_id").val();
val_url += "&right=" + $("#cbb_user_right").val();
val_url += "&pid=" + $("#pid").val();
val_url += "&add_user_email=" + $("#add_user_email").val();
val_url += "&add_user_title=" + $("#add_user_title").val();
$.ajax({
url: val_url,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment