From 8c223ddf5182ace2ae1636ceb69b7100fb047baa Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 7 Feb 2022 13:33:02 +0100 Subject: [PATCH] Popravek pri omejitvi alternativnega emaila --- admin/survey/SurveyAdminAjax.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/admin/survey/SurveyAdminAjax.php b/admin/survey/SurveyAdminAjax.php index 99b501d6e..2e882b0d4 100644 --- a/admin/survey/SurveyAdminAjax.php +++ b/admin/survey/SurveyAdminAjax.php @@ -742,6 +742,14 @@ class SurveyAdminAjax { // naredi link za aktivacijo $code = base64_encode((hash('SHA256', time() .$pass_salt . $email. $rowU['name']))); + //Preverimo, koliko alternativnih emailov ima (dovolimo samo 10) + $sql_user_to_be = sisplet_query ("SELECT count(id) AS skupaj FROM users_to_be WHERE user_id='" . $global_user_id . "'"); + $row_user_to_be = mysqli_fetch_array($sql_user_to_be); + if($row_user_to_be['skupaj'] > 10){ + echo 'error'; + return true; + } + // Vstavimo novega userja v users_to_be kjer caka na aktivacijo $insert_id = sisplet_query ("INSERT INTO users_to_be (type, email, name, user_id, timecode, code, lang)