Commit 183cd847 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

send an email when a user is added to the system

parent 1804a0e3
...@@ -476,6 +476,14 @@ class tx_nG6_eid { ...@@ -476,6 +476,14 @@ class tx_nG6_eid {
$project_id = trim(t3lib_div::_GP('project_id')); $project_id = trim(t3lib_div::_GP('project_id'));
$right_id = trim(t3lib_div::_GP('right')); $right_id = trim(t3lib_div::_GP('right'));
$group_name = trim(t3lib_div::_GP('group')); $group_name = trim(t3lib_div::_GP('group'));
$email = trim(t3lib_div::_GP('email'));
$first_name = trim(t3lib_div::_GP('first_name'));
$last_name = trim(t3lib_div::_GP('last_name'));
$password = trim(t3lib_div::_GP('password'));
$cruser_id = trim(t3lib_div::_GP('creator'));
$clearpassword = trim(t3lib_div::_GP('clearpassword'));
$from_email = trim(t3lib_div::_GP('from_email'));
$pid = trim(t3lib_div::_GP('pid'));
// if group not exists, create group // if group not exists, create group
$group_id = tx_nG6_db::get_group_id($group_name); $group_id = tx_nG6_db::get_group_id($group_name);
...@@ -492,16 +500,8 @@ class tx_nG6_eid { ...@@ -492,16 +500,8 @@ class tx_nG6_eid {
// if user not exists in DB // if user not exists in DB
if(!isset($c_user_id)){ if(!isset($c_user_id)){
$first_name = trim(t3lib_div::_GP('first_name')); $create_user_email = trim(t3lib_div::_GP('create_user_email'));
$last_name = trim(t3lib_div::_GP('last_name')); $create_user_title = trim(t3lib_div::_GP('create_user_title'));
$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'));
$clearpassword = trim(t3lib_div::_GP('clearpassword'));
$from_email = trim(t3lib_div::_GP('from_email'));
$pid = trim(t3lib_div::_GP('pid'));
tx_nG6_db::create_new_user($user_name, $first_name, $last_name, $email, $password, $cruser_id, $group_id, $pid); tx_nG6_db::create_new_user($user_name, $first_name, $last_name, $email, $password, $cruser_id, $group_id, $pid);
...@@ -532,6 +532,8 @@ class tx_nG6_eid { ...@@ -532,6 +532,8 @@ class tx_nG6_eid {
// send an email to the user // send an email to the user
if ($email != "") { if ($email != "") {
$add_user_email = trim(t3lib_div::_GP('add_user_email'));
$add_user_title = trim(t3lib_div::_GP('add_user_title'));
$project = tx_nG6_db::select_project($project_id); $project = tx_nG6_db::select_project($project_id);
$message = str_replace("###USER_FIRST_NAME###", $first_name, $add_user_email); $message = str_replace("###USER_FIRST_NAME###", $first_name, $add_user_email);
......
...@@ -1112,6 +1112,8 @@ $(function () { ...@@ -1112,6 +1112,8 @@ $(function () {
val_url += "&pid=" + $("#pid").val(); val_url += "&pid=" + $("#pid").val();
val_url += "&add_user_email=" + escape($("#add_user_email").val()); val_url += "&add_user_email=" + escape($("#add_user_email").val());
val_url += "&add_user_title=" + $("#add_user_title").val(); val_url += "&add_user_title=" + $("#add_user_title").val();
val_url += "&create_user_email=" + escape($("#create_user_email").val());
val_url += "&create_user_title=" + $("#create_user_title").val();
val_url += "&from_email=" + $("#from_email").val(); val_url += "&from_email=" + $("#from_email").val();
$.ajax({ $.ajax({
......
Supports Markdown
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