From 3cbe01ea7df2f628e767b7b00e7c1612062c05ab Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sun, 16 Mar 2014 22:26:19 +0100 Subject: Checks if user really invited. --- www/functions/func_invite.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'www/functions/func_invite.php') diff --git a/www/functions/func_invite.php b/www/functions/func_invite.php index ad87a21..b37ea09 100755 --- a/www/functions/func_invite.php +++ b/www/functions/func_invite.php @@ -15,6 +15,13 @@ function invite($db){ return INVITE_INVITES; } + $email_db = $db->query("Select 1 FROM user WHERE email='" . $safe_email . "';"); + $email_ar = $email_db->fetchArray(SQLITE3_NUM); + + if($email_ar[0] == 1){ + return INVITE_USEREXISTS; + } + /*Generates the invite key => [-_0-9a-zA-Z]{11}*/ $key_array = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "_", "-", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ); -- cgit v1.2.3