summaryrefslogtreecommitdiff
path: root/www/functions/func_invite.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/functions/func_invite.php')
-rwxr-xr-xwww/functions/func_invite.php7
1 files changed, 7 insertions, 0 deletions
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" );