diff --git a/admin/survey/SurveyAdminAjax.php b/admin/survey/SurveyAdminAjax.php index bde3184c1..34a56cb08 100644 --- a/admin/survey/SurveyAdminAjax.php +++ b/admin/survey/SurveyAdminAjax.php @@ -6275,10 +6275,14 @@ class SurveyAdminAjax { $id = 0; $sqlu = sisplet_query("SELECT id FROM users WHERE email='$email'"); + $create_new_account = false; + // Ce user, ki ga dodajamo, se ne obstaja, ga ustvarimo - PO NOVEM SAMO CE SMO ADMIN if (mysqli_num_rows($sqlu) == 0 && $admin_type == 0) { $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surnname', '$email', '" .base64_encode((hash(SHA256, '' .$pass_salt))) ."', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')"); $id = mysqli_insert_id($GLOBALS['connect_db']); + + $create_new_account = true; } // Drugace pridobimo podatke o userju iz baze else { @@ -6330,10 +6334,12 @@ class SurveyAdminAjax { $MA->addRecipients($email); $resultX = $MA->sendMail(stripslashes($content), $subject); - if($resultX) - echo ''.$email.' - '.$lang['srv_dostop_addusers_success'].''; - else + if($resultX){ + echo ''.$email.' - '.($create_new_account ? $lang['srv_dostop_addusers_success_create'] : $lang['srv_dostop_addusers_success']).''; + } + else{ echo ''.$email.' - '.$lang['srv_dostop_addusers_error3'].''; + } } catch (Exception $e){ echo ''.$email.' - '.$lang['srv_dostop_addusers_error3'].''; diff --git a/lang/1.php b/lang/1.php index 604a9bc89..fa6e1221f 100644 --- a/lang/1.php +++ b/lang/1.php @@ -2060,7 +2060,8 @@ $lang = array ( "srv_dostop_addusers_error2" => "Uporabnik s tem e-poštnim naslovom še ni registriran!", "srv_dostop_addusers_error3" => "Prišlo je do napake pri pošiljanju obvestila!", "srv_dostop_addusers_error4" => "Uporabnik že ima dostop do urejanja ankete.", - "srv_dostop_addusers_success" => "Uspešno dodan dostop in poslano sporočilo.", + "srv_dostop_addusers_success" => "Uspešno je bil dodan dostop in poslano sporočilo.", + "srv_dostop_addusers_success_create" => "Uspešno je bil dodan nov uporabnik in poslano sporočilo.", "srv_dostop_activetxt" => "Aktivni uporabniki lahko normalno urejajo in pregledujejo anketo. Pasivni pa vidijo zgolj zavihka Analiza in Poročila", "srv_dostop_show_all" => "Prikaži vse.", "srv_dostop_hide_all" => "Skrij neizbrane.", diff --git a/lang/2.php b/lang/2.php index 98a4bd3b6..c69bd71c5 100644 --- a/lang/2.php +++ b/lang/2.php @@ -2048,6 +2048,7 @@ $lang = array ( "srv_dostop_addusers_error3" => "There was an error sending the notification !", "srv_dostop_addusers_error4" => "The user already has access to the survey.", "srv_dostop_addusers_success" => "Access added and notification successfully sent.", + "srv_dostop_addusers_success_create" => "Account created and notification successfully sent.", "srv_dostop_activetxt" => "Active users have normal editing rights. Passive users can only view the survey.", "srv_dostop_show_all" => "Show all.", "srv_dostop_hide_all" => "Hide unselected.",